//package com.yy.cloud.config;
//
//import com.yy.cloud.loadbalancer.CustomLoadBalancer;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.cloud.client.ServiceInstance;
//import org.springframework.cloud.loadbalancer.core.ReactorLoadBalancer;
//import org.springframework.cloud.loadbalancer.core.ServiceInstanceListSupplier;
//import org.springframework.cloud.loadbalancer.support.LoadBalancerClientFactory;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.core.env.Environment;
//
///**
// * CustomLoadBalancer 自定义的负载均衡算法不起作用，不知道啥作用
// *
// * @date 2024/5/6
// */
//@Configuration
//@Slf4j
//public class LoadbalancerConfiguration {
//
//
//    @Bean
//    public ReactorLoadBalancer<ServiceInstance> customLoadBalancer(Environment environment, LoadBalancerClientFactory loadBalancerClientFactory) {
//        String name = environment.getProperty(LoadBalancerClientFactory.PROPERTY_NAME);
//        log.info("LoadbalancerConfiguration 中 name = {}", name);
//        return new CustomLoadBalancer(loadBalancerClientFactory.getLazyProvider(name, ServiceInstanceListSupplier.class), name);
//    }
//}
